package cn.tedn.exec;
/*本类用于oop综合案例2-设计图形业务*/
public class TestShape {
    public static void main(String[] args) {
//        Shape s=new Shape();//抽象类不可实例化
//        s.draw();
//        s.clear();
//        s.draw();

        Circle c = new Circle();
        c.draw();
        c.clear();

        Square s2 = new Square();
        s2.draw();
        s2.area();
        s2.clear();
    }
}
abstract class Shape{
//    创建父类的方法
    public abstract void draw();
    public abstract void clear();
}
class Circle extends Shape{
    @Override
    public void draw(){
        System.out.println("画个○");
    }

    @Override
    public void clear() {

    }
}
class Square extends Shape{
    public void draw(){
        System.out.println("画个□");
    }

    @Override
    public void clear() {

    }

    public void area(){
        System.out.println("这个方形的面积不太大~！");
    }
}